import express from "express";
import { ratingController } from "../controllers/rating";

const router = express.Router();

// 创建或更新评分
router.post("/:torrentId", ratingController.createOrUpdateRating);

// 获取种子的所有评分
router.get("/torrent/:torrentId", ratingController.getTorrentRatings);

// 获取用户的所有评分
router.get("/user/:userId", ratingController.getUserRatings);

// 获取用户对特定种子的评分
router.get(
  "/torrent/:torrentId/user/:userId",
  ratingController.getUserRatingForTorrent
);

// 获取种子的评分统计
router.get("/torrent/:torrentId/stats", ratingController.getTorrentRatingStats);

// 删除评分
router.delete("/:ratingId", ratingController.deleteRating);

export default router;
